﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Admin.Domain;

namespace Windows.Admin.Infrastructure.EFCore.Extensions
{
    public static class ChatMessageExtension
    {
        /// <summary>
        /// 获取未读消息
        /// </summary>
        /// <param name="query"></param>
        /// <param name="userId1"></param>
        /// <param name="userId2"></param>
        /// <returns></returns>
        public static IQueryable<ChatMessage> GetNoReadByUserId(this IQueryable<ChatMessage> query, int userId)
        {
            return query.Where(x => x.SenderId == userId && !x.IsRead);
        }
    }
}
